package com.yuexunit.operationman.nbsy.module.Login.adapter;

import android.widget.AbsListView;

import com.yuexunit.operationman.nbsy.R;
import com.yuexunit.operationman.nbsy.module.Login.bean.PatientListBean;

import org.kymjs.kjframe.widget.AdapterHolder;
import org.kymjs.kjframe.widget.KJAdapter;

import java.util.Collection;

/**
 * Created by Administrator on 2018/10/24 0024.
 */

public class PatientListAdapter extends KJAdapter<PatientListBean.ObjectBean.ListBean> {
    public PatientListAdapter(AbsListView view, Collection mDatas, int itemLayoutId) {
        super(view, mDatas, itemLayoutId);
    }

    @Override
    public void convert(AdapterHolder adapterHolder, PatientListBean.ObjectBean.ListBean item, boolean isScrolling) {
        adapterHolder.setText(R.id.item_patient_name, item.getPatientName());
        adapterHolder.setText(R.id.item_patient_level, item.getOperationLevel());
        adapterHolder.setText(R.id.item_patien_order_date, item.getOperationOrderDateStr());
        adapterHolder.setText(R.id.item_patien_bed, item.getPatientBed());
        adapterHolder.setText(R.id.item_patien_hospital, item.getInHospitalNo());
        adapterHolder.setText(R.id.item_patien_doctor, item.getOperator());
        if(item.getPreOperation()!=null)
        {
            adapterHolder.setText(R.id.item_patien_disease, item.getPreOperation());
        }
        else {
            adapterHolder.setText(R.id.item_patien_disease, "");
        }

    }
}
